<!DOCTYPE html>
<html lang="en">
<!--<script src="myscript.js"></script>-->
<head>
    <meta charset="UTF-8">
    <title>js简介</title>
    <script type="text/javascript">

        document.write("<h1> 这是一个简介 </h1>")
        document.write("<h1> 这也是一个简介 </h1>")

    </script>

    <script>
        var a = "hello world"
        var b = "nice javascript"
        var c = "nice java"
        var str = "python|java|js|php"
        var big = "HELLO WORLD"
        var num = 1
        var g = "   hello world 1   "
        var strNum = "123455"
        var dict = {first: 1, second: 2, third: 3}
        var myList = [1, 2, 3]

        console.log("111", a.charAt(3))
        console.log(a.charCodeAt(3))
        console.log(a.concat(b))
        console.log(a.indexOf("l"))
        console.log(a.lastIndexOf("l"))
        console.log("222", b.localeCompare(c))

        var d = b.match("(.*) java")
        console.log(d)
        var e = c.replace("(.*) java", "good")
        console.log(c)
        console.log(str.split("|"))
        var new_c = c.slice(0, -1)
        console.log(c, new_c)
        console.log(c.substring(0, 3))
        console.log(str.toLocaleUpperCase())
        console.log(str.toUpperCase())
        console.log(big.toLocaleLowerCase())
        console.log(big.toLowerCase())
        console.log(num.toString(), typeof num.toString())
        console.log(g.trim())
        console.log(strNum.valueOf(), typeof strNum.valueOf())

        var x;
        x = 5
        console.log(x, ++x)
        console.log(x)

        console.log(big + num)

    </script>
</head>
<body>
<button type="button" onclick="alert('hello world')">点击我</button>
</body>
</html>